/*
 * Created on 2006-7-3
 */
package messages;

import java.awt.geom.Point2D;
import java.text.DecimalFormat;
import java.text.NumberFormat;

public class Message implements Comparable<Message> {
	public int senderID;

	public int messageType;

	public int timepoint;

	public int receiver;

	public int sendMode;

	public Point2D msgLoc;
	static NumberFormat formatter = new DecimalFormat("####.###");
	public int compareTo(Message o) {
		if (this.timepoint < o.timepoint) {
			return -1;
		} else if (this.timepoint > o.timepoint) {
			return 1;
		} else {
			if (senderID < o.senderID) {
				return -1;
			} else if (senderID > o.senderID) {
				return 1;
			} else {
				return 0;
			}
		}
	}
}
